package com.huanletao.dom4j.pojo;

import com.huanletao.dom4j.annotation.ElementFormat;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.Date;
import java.util.StringJoiner;

/**
 * <p>
 *
 * </p>
 *
 * @package: com.huanletao.dom4j.pojo
 * @Description:
 * @className: Student
 * @author: @NNCSKJ ADMIN
 * @copyright: Copyright (c) 2022/8/2 16:01
 * @version: V1.0
 */
@XmlRootElement(name = "soap:student")
public class Student {
    @XmlElement(name = "name")
    private String name;
    @XmlElement(name = "gradeName")
    private String gradeName;
    @XmlElement(name = "sex")
    private String sex;
    @XmlElement(name = "age")
    private Integer age;
    @XmlElement(name = "dateOfBirth")
    @ElementFormat(pattern = "yyyy-MM-dd")
    private Date dateOfBirth;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGradeName() {
        return gradeName;
    }

    public void setGradeName(String gradeName) {
        this.gradeName = gradeName;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Date getDateOfBirth() {
        return dateOfBirth;
    }

    public void setDateOfBirth(Date dateOfBirth) {
        this.dateOfBirth = dateOfBirth;
    }

    @Override
    public String toString() {
        return new StringJoiner(", ", Student.class.getSimpleName() + "[", "]")
                .add("name='" + name + "'")
                .add("gradeName='" + gradeName + "'")
                .add("sex='" + sex + "'")
                .add("age=" + age)
                .add("dateOfBirth=" + dateOfBirth)
                .toString();
    }
}
